from django.db import models
from op_drf.base import BaseModel
import os
import uuid
from django.contrib.auth.models import AbstractUser
from django.db.models import CharField, FileField, BooleanField, IntegerField, TextField
from django.utils import timezone

class CodeManage(BaseModel):
    """编码"""

    name = models.CharField(max_length=100, verbose_name="名称", null=True, blank=True)
    app = models.CharField(max_length=200, verbose_name="应用", null=True, blank=True)
    model = models.CharField(max_length=200, verbose_name="模型", null=True, blank=True)
    field = models.CharField(max_length=100, verbose_name="字段", null=True, blank=True)
    rule = models.TextField(verbose_name="规则", null=True, blank=True)
    sequence_len = models.IntegerField(verbose_name="序列长度", default=4, blank=True)
    is_active = models.BooleanField(verbose_name="是否启用", default=False)
    anchor_point = models.CharField(max_length=100, verbose_name="键值", null=True, blank=True)

    class Meta:
        db_table = "atm_code_manage"
        verbose_name = "编码管理"
        verbose_name_plural = verbose_name